var webpack = require('webpack');
var path = require('path');
//加载一些插件 
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
// var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlwebpackPlugin = require('html-webpack-plugin');
    module.exports = {
        entry: {
            main:"./main.js",
            activities:"./activities.js",
        },
        output: {
            path: path.join(__dirname, "/app/"),
            filename: "[name].lgc.js"
        },
        module: {
            loaders: [
                { test: /\.vue$/, loader: 'vue' },
                { test: /\.css$/, loader: 'style!css!less' },
                { test: /\.(jpg)$/, loader: "url-loader?name=[path][name].[ext]&limit=8192" },
                { test: /\.(png|jpeg|gif)$/, loader: 'file-loader?name=[path][name].[ext]' }
            ]
        }, 
        // .vue的配置。需要单独出来配置
        vue: {
            loaders: {
                css: 'style!css',
                html: 'html-loader'
            }
        },
        plugins: [
            // new ExtractTextPlugin("css/index.css"),
            // new webpack.optimize.UglifyJsPlugin({ //压缩代码
            //     compress: {
            //         warnings: false
            //     },
            //     except: ['$super', '$', 'exports', 'require'] //排除关键字
            // }),
            //添加我们的插件 会自动生成一个html文件
            new HtmlwebpackPlugin({
                filename: 'camp.html',
                template: path.join(__dirname, 'src/camp.html'),
                inject: false,
                hash: true,
            }),
            new HtmlwebpackPlugin({
                filename: 'activities.html',
                template: path.join(__dirname, 'src/activities.html'),
                inject: false,
                hash: true,
            })
        ]

    };
